// 员工接口
import request from '@/utils/request'
export function fetchEmployeeList(params) {
  return request({
    method: 'GET',
    url: '/sys/user',
    params
  })
}
// 新增员工接口
export function fetchAddEmployee(data) {
  return request({
    method: 'POST',
    url: '/sys/user',
    data
  })
}
/**
 * @description: 删除员工
 * @param {*} id 员工id
 * @return {*}
 */
export function fetchDelEmployee(id) {
  return request({
    method: 'DELETE',
    url: `/sys/user/${id}`
  })
}

/**
 * @description: 导入excel
 * @param {*} data
    [{
      	 mobile: 15751786320
      	 timeOfEntry: "2019-03-09T16:00:00.000Z"
     	 username: "测试人员1"
     	 workNumber: 88088,
     	 formOfEmployment: 0,
     	 departmentName: "技术部"
      }
    ]
 * @return {*}
 */
export function fetchImportExcel(data) {
  return request({
    url: '/sys/user/batch',
    method: 'POST',
    data
  })
}

//  分配员工
export function fetchAssignRole(data) {
  return request({
    url: '/sys/user/assignRoles',
    method: 'PUT',
    data
  })
}
